package com.softtek.base.action.converter;

import com.softtek.base.domain.DepartmentInfo;
import com.softtek.base.sugar.tools.DateTimeUtils;
import com.softtek.base.sugar.web.WebLayerUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;

import java.util.List;

/**
 * Created by Administrator on 2015-08-18.
 */
public class DepartmentInfoConverter {

    public static JSONObject getJson(List<DepartmentInfo> departmentInfoList, Long totalNum) {
        JSONObject result = new JSONObject();
        JSONArray jsonArray = new JSONArray();

        for (DepartmentInfo departmentInfo : departmentInfoList) {
            JSONObject jsonObject = new JSONObject();

            jsonObject.put("departmentInfoId", WebLayerUtil.getDefaultByNullLong(departmentInfo.getDepartmentInfoId(), 0L));
            jsonObject.put("interviewUserName", WebLayerUtil.getDefaultByNullString(departmentInfo.getInterviewUserName(), ""));
            jsonObject.put("departmentChannel", WebLayerUtil.getDefaultByNullString(departmentInfo.getDepartmentChannel(), ""));
            jsonObject.put("departmentNum", WebLayerUtil.getDefaultByNullString(departmentInfo.getDepartmentNum(), ""));
            jsonObject.put("departmentName", WebLayerUtil.getDefaultByNullString(departmentInfo.getDepartmentName(), ""));
            if (departmentInfo.getQuestionTwo() != null) {
                jsonObject.put("status", WebLayerUtil.getDefaultByNullString("已编辑", ""));
            } else {
                jsonObject.put("status", WebLayerUtil.getDefaultByNullString("待编辑", ""));
            }
            jsonArray.add(jsonObject);
        }

        result.put("total", totalNum);
        result.put("rows", jsonArray);

        return result;
    }


    public static JSONObject getJson(List<DepartmentInfo> departmentInfoList) {
        JSONObject result = new JSONObject();
        JSONArray jsonArray = new JSONArray();

        String path = "http://localhost:8080/dp/";

        for (DepartmentInfo departmentInfo : departmentInfoList) {
            JSONObject jsonObject = new JSONObject();
            //门店信息
            jsonObject.put("interviewUserName", WebLayerUtil.getDefaultByNullString(departmentInfo.getInterviewUserName(), ""));
            jsonObject.put("interviewDate", WebLayerUtil.getDefaultByNullString(DateTimeUtils.formatDateToString(departmentInfo.getInterviewDate()), ""));
            jsonObject.put("enterDepartmentDate", WebLayerUtil.getDefaultByNullString(DateTimeUtils.formatDateToString(departmentInfo.getEnterDepartmentDate()), ""));
            jsonObject.put("leaveDepartmentDate", WebLayerUtil.getDefaultByNullString(DateTimeUtils.formatDateToString(departmentInfo.getLeaveDepartmentDate()), ""));
            jsonObject.put("departmentNum", WebLayerUtil.getDefaultByNullString(departmentInfo.getDepartmentNum(), ""));
            jsonObject.put("departmentChannel", WebLayerUtil.getDefaultByNullString(departmentInfo.getDepartmentChannel(), ""));
            jsonObject.put("departmentName", WebLayerUtil.getDefaultByNullString(departmentInfo.getDepartmentName(), ""));
            jsonObject.put("departmentAddress", WebLayerUtil.getDefaultByNullString(departmentInfo.getDepartmentAddress(), ""));
            //问题Q1A
            jsonObject.put("questionOneAAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionOneAAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionOneAAnswer()) && departmentInfo.getQuestionOneAAnswer().equals("1")) {
                jsonObject.put("questionOneAPrice", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionOneAPrice(), ""));
            } else {
                jsonObject.put("questionOneAPrice", WebLayerUtil.getDefaultByNullString("--", ""));
            }
            //问题Q1B
            jsonObject.put("questionOneBAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionOneBAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionOneBAnswer()) && departmentInfo.getQuestionOneBAnswer().equals("1")) {
                jsonObject.put("questionOneBPrice", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionOneBPrice(), ""));
            } else {
                jsonObject.put("questionOneBPrice", WebLayerUtil.getDefaultByNullString("--", ""));
            }
            //问题Q1C
            jsonObject.put("questionOneCAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionOneCAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionOneCAnswer()) && departmentInfo.getQuestionOneCAnswer().equals("1")) {
                jsonObject.put("questionOneCPrice", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionOneCPrice(), ""));
            } else {
                jsonObject.put("questionOneCPrice", WebLayerUtil.getDefaultByNullString("--", ""));
            }

            //问题Q1D
            jsonObject.put("questionOneDAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionOneDAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionOneDAnswer()) && departmentInfo.getQuestionOneDAnswer().equals("1")) {
                jsonObject.put("questionOneDPrice", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionOneDPrice(), ""));
            } else {
                jsonObject.put("questionOneDPrice", WebLayerUtil.getDefaultByNullString("--", ""));
            }

            //问题Q1E
            jsonObject.put("questionOneEAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionOneEAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionOneEAnswer()) && departmentInfo.getQuestionOneEAnswer().equals("1")) {
                jsonObject.put("questionOneEPrice", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionOneEPrice(), ""));
            } else {
                jsonObject.put("questionOneEPrice", WebLayerUtil.getDefaultByNullString("--", ""));
            }

            //问题Q1F
            jsonObject.put("questionOneFAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionOneFAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionOneFAnswer()) && departmentInfo.getQuestionOneFAnswer().equals("1")) {
                jsonObject.put("questionOneFPrice", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionOneFPrice(), ""));
            } else {
                jsonObject.put("questionOneFPrice", WebLayerUtil.getDefaultByNullString("--", ""));
            }

            //问题Q1G
            jsonObject.put("questionOneGAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionOneGAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionOneGAnswer()) && departmentInfo.getQuestionOneGAnswer().equals("1")) {
                jsonObject.put("questionOneGPrice", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionOneGPrice(), ""));
            } else {
                jsonObject.put("questionOneGPrice", WebLayerUtil.getDefaultByNullString("--", ""));
            }

            //问题Q1H
            jsonObject.put("questionOneHAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionOneHAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionOneHAnswer()) && departmentInfo.getQuestionOneHAnswer().equals("1")) {
                jsonObject.put("questionOneHPrice", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionOneHPrice(), ""));
            } else {
                jsonObject.put("questionOneHPrice", WebLayerUtil.getDefaultByNullString("--", ""));
            }

            //问题Q2
            if (departmentInfo.getQuestionTwo() != null) {
                jsonObject.put("questionTwoAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionTwo().getQuestionTwoAnswer(), "--"));

                if (departmentInfo.getQuestionTwo().getQuestionTwoAnswer().equals("1")) {
                    if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionTwoTypeA())) {
                        jsonObject.put("questionTwoTypeA", WebLayerUtil.getDefaultByNullString("陈列1", "--"));
                        jsonObject.put("questionTwoNumA", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionTwo().getQuestionTwoNumA(), "--"));
                    } else {
                        jsonObject.put("questionTwoTypeA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                        jsonObject.put("questionTwoNumA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    }

                    if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionTwoTypeB())) {
                        jsonObject.put("questionTwoTypeB", WebLayerUtil.getDefaultByNullString("陈列2", "--"));
                        jsonObject.put("questionTwoNumB", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionTwo().getQuestionTwoNumB(), "--"));
                    } else {
                        jsonObject.put("questionTwoTypeB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                        jsonObject.put("questionTwoNumB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    }

                    if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionTwoTypeC())) {
                        jsonObject.put("questionTwoTypeC", WebLayerUtil.getDefaultByNullString("陈列3", "--"));
                        jsonObject.put("questionTwoNumC", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionTwo().getQuestionTwoNumC(), "--"));
                    } else {
                        jsonObject.put("questionTwoTypeC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                        jsonObject.put("questionTwoNumC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    }

                    if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionTwoTypeD())) {
                        jsonObject.put("questionTwoTypeD", WebLayerUtil.getDefaultByNullString("陈列4", "--"));
                        jsonObject.put("questionTwoNumD", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionTwo().getQuestionTwoNumD(), "--"));
                    } else {
                        jsonObject.put("questionTwoTypeD", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                        jsonObject.put("questionTwoNumD", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    }

                    if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionTwoTypeE())) {
                        jsonObject.put("questionTwoTypeE", WebLayerUtil.getDefaultByNullString("陈列5", "--"));
                        jsonObject.put("questionTwoNumE", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionTwo().getQuestionTwoNumE(), "--"));
                    } else {
                        jsonObject.put("questionTwoTypeE", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                        jsonObject.put("questionTwoNumE", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    }

                    if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionTwoTypeG())) {
                        jsonObject.put("questionTwoTypeG", WebLayerUtil.getDefaultByNullString("其他地堆/陈列", "--"));
                        jsonObject.put("questionTwoNumG", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionTwo().getQuestionTwoNumG(), "--"));
                    } else {
                        jsonObject.put("questionTwoTypeG", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                        jsonObject.put("questionTwoNumG", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    }
                } else {
                    jsonObject.put("questionTwoTypeA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoNumA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoTypeB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoNumB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoTypeC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoNumC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoTypeD", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoNumD", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoTypeE", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoNumE", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoTypeG", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionTwoNumG", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                }

                if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerA())) {
                    jsonObject.put("questionFourOneAnswerA", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerA(), "--"));
                    jsonObject.put("questionFourOneAnswerANum", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerANum(), "--"));
                } else {
                    jsonObject.put("questionFourOneAnswerA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionFourOneAnswerANum", WebLayerUtil.getDefaultByNullString(null, "--"));
                }

                if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerB())) {
                    jsonObject.put("questionFourOneAnswerB", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerB(), "--"));
                    jsonObject.put("questionFourOneAnswerBNum", WebLayerUtil.getDefaultByNullString(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerBNum(), "--"));
                } else {
                    jsonObject.put("questionFourOneAnswerB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    jsonObject.put("questionFourOneAnswerBNum", WebLayerUtil.getDefaultByNullString(null, "--"));
                }

                if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerC())) {
                    jsonObject.put("questionFourOneAnswerC", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerC(), "--"));
                } else {
                    jsonObject.put("questionFourOneAnswerC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                }
                if (StringUtils.isNotBlank(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerD())) {
                    jsonObject.put("questionFourOneAnswerD", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionTwo().getQuestionFourOneAnswerD(), "--"));
                } else {
                    jsonObject.put("questionFourOneAnswerD", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                }

                jsonObject.put("questionTenAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionTwo().getQuestionTenAnswer(), "--"));
                jsonObject.put("questionElevenAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionTwo().getQuestionElevenAnswer(), "--"));


            } else {
                jsonObject.put("questionTwoAnswer", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoTypeA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoNumA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoTypeB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoNumB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoTypeC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoNumC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoTypeD", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoNumD", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoTypeE", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoNumE", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoTypeG", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionTwoNumG", WebLayerUtil.getDefaultByNullStringResult(null, "--"));

                jsonObject.put("questionFourOneAnswerA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionFourOneAnswerANum", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionFourOneAnswerB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionFourOneAnswerBNum", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionFourOneAnswerC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionFourOneAnswerD", WebLayerUtil.getDefaultByNullStringResult(null, "--"));

                jsonObject.put("questionTenAnswer", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionElevenAnswer", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            }

            //问题3
            jsonObject.put("questionThreeAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionThreeAnswer(), "--"));

            //问题4
            jsonObject.put("questionFourAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionFourAnswer(), "--"));

            //问题5
            jsonObject.put("questionFiveAnswer", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionFiveAnswer(), "--"));
            if (StringUtils.isNotBlank(departmentInfo.getQuestionFiveAnswer()) && departmentInfo.getQuestionFiveAnswer().equals("1")) {
                jsonObject.put("questionFiveAnswerA", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionFiveAnswerA(), "--"));
                jsonObject.put("questionFiveAnswerB", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionFiveAnswerB(), "--"));
                jsonObject.put("questionFiveAnswerC", WebLayerUtil.getDefaultByNullStringResult(departmentInfo.getQuestionFiveAnswerC(), "--"));
            } else {
                jsonObject.put("questionFiveAnswerA", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionFiveAnswerB", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                jsonObject.put("questionFiveAnswerC", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            }

            //问题6
            if (StringUtils.isBlank(departmentInfo.getQuestionSixAnswer())) {
                jsonObject.put("questionSixAnswer", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            } else if (departmentInfo.getQuestionSixAnswer().equals("a")) {
                jsonObject.put("questionSixAnswer", WebLayerUtil.getDefaultByNullString("活动“买满***金额，送***礼品”", "--"));
            } else if (departmentInfo.getQuestionSixAnswer().equals("b")) {
                if (StringUtils.isNotBlank(departmentInfo.getQuestionSixAnswerSelf())) {
                    jsonObject.put("questionSixAnswer", WebLayerUtil.getDefaultByNullString("其他宣传物料，请注明" + departmentInfo.getQuestionSixAnswerSelf(), "--"));
                } else {
                    jsonObject.put("questionSixAnswer", WebLayerUtil.getDefaultByNullString("其他宣传物料，请注明", "--"));
                }

            } else if (departmentInfo.getQuestionSixAnswer().equals("c")) {
                jsonObject.put("questionSixAnswer", WebLayerUtil.getDefaultByNullString("无 ", "--"));
            } else if (departmentInfo.getQuestionSixAnswer().equals("d")) {
                jsonObject.put("questionSixAnswer", WebLayerUtil.getDefaultByNullString("非麦德龙或山姆会员店", "--"));
            } else {
                jsonObject.put("questionSixAnswer", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            }
            //问题7
            if (StringUtils.isBlank(departmentInfo.getQuestionSevenAnswerOne())) {
                jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            } else if (departmentInfo.getQuestionSevenAnswerOne().equals("1")) {
                jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("促销员在店", "--"));
            } else if (departmentInfo.getQuestionSevenAnswerOne().equals("2")) {
                jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("等待15分钟后促销员在店", "--"));
            } else if (departmentInfo.getQuestionSevenAnswerOne().equals("3")) {
                jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("无促销员", "--"));
            } else {
                jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            }

            if (StringUtils.isNotBlank(departmentInfo.getQuestionSevenAnswerOne()) && departmentInfo.getQuestionSevenAnswerOne().equals("3")) {
                if (StringUtils.isNotBlank(departmentInfo.getQuestionSevenAnswerTwo())) {
                    if (departmentInfo.getQuestionSevenAnswerTwo().equals("1")) {
                        jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("促销员一整天请假", "--"));
                    } else if (departmentInfo.getQuestionSevenAnswerTwo().equals("2")) {
                        jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("促销员已辞职", "--"));
                    } else if (departmentInfo.getQuestionSevenAnswerTwo().equals("3")) {
                        jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("促销员临时请假（今天来过，后来离开）", "--"));
                    } else if (departmentInfo.getQuestionSevenAnswerTwo().equals("4")) {
                        jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("促销员在吃饭，未能在15分钟回到岗位", "--"));
                    } else if (departmentInfo.getQuestionSevenAnswerTwo().equals("5")) {
                        jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("促销员临时离店未知理由，未能在15分钟内回到岗位", "--"));
                    } else if (departmentInfo.getQuestionSevenAnswerTwo().equals("97")) {
                        if (StringUtils.isNotBlank(departmentInfo.getQuestionSevenAnswerTwoSelf())) {
                            jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("其他，请注明" + departmentInfo.getQuestionSevenAnswerTwoSelf(), "--"));
                        } else {
                            jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("其他，请注明", "--"));
                        }

                    } else if (departmentInfo.getQuestionSevenAnswerTwo().equals("99")) {
                        jsonObject.put("questionSevenAnswerOne", WebLayerUtil.getDefaultByNullString("无法判断促销员不在店原因", "--"));
                    } else {
                        jsonObject.put("questionSevenAnswerTwo", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                    }
                } else {
                    jsonObject.put("questionSevenAnswerTwo", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
                }
            } else {
                jsonObject.put("questionSevenAnswerTwo", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            }

            //问题8
            if (StringUtils.isBlank(departmentInfo.getQuestionEightAnswer())) {
                jsonObject.put("questionEightAnswer", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            } else if (departmentInfo.getQuestionEightAnswer().equals("a")) {
                jsonObject.put("questionEightAnswer", WebLayerUtil.getDefaultByNullString("轩尼诗制服", "--"));
            } else if (departmentInfo.getQuestionEightAnswer().equals("b")) {
                jsonObject.put("questionEightAnswer", WebLayerUtil.getDefaultByNullString("尊尼获加蓝牌制服", "--"));
            } else if (departmentInfo.getQuestionEightAnswer().equals("c")) {
                jsonObject.put("questionEightAnswer", WebLayerUtil.getDefaultByNullString("其他制服", "--"));
            } else if (departmentInfo.getQuestionEightAnswer().equals("d")) {
                jsonObject.put("questionEightAnswer", WebLayerUtil.getDefaultByNullString("未着制服", "--"));
            } else if (departmentInfo.getQuestionEightAnswer().equals("e")) {
                jsonObject.put("questionEightAnswer", WebLayerUtil.getDefaultByNullString("无促销员", "--"));
            } else {
                jsonObject.put("questionEightAnswer", WebLayerUtil.getDefaultByNullStringResult(null, "--"));
            }

            //问题9
            if (StringUtils.isBlank(departmentInfo.getQuestionNineAnswer())) {
                jsonObject.put("questionNineAnswer", WebLayerUtil.getDefaultByNullString(null, "--"));
            } else if (departmentInfo.getQuestionNineAnswer().equals("1")) {
                jsonObject.put("questionNineAnswer", WebLayerUtil.getDefaultByNullString("是", "--"));
            } else if (departmentInfo.getQuestionNineAnswer().equals("2")) {
                jsonObject.put("questionNineAnswer", WebLayerUtil.getDefaultByNullString("否", "--"));
            } else if (departmentInfo.getQuestionNineAnswer().equals("3")) {
                jsonObject.put("questionNineAnswer", WebLayerUtil.getDefaultByNullString("无促销员", "--"));
            } else {
                jsonObject.put("questionNineAnswer", WebLayerUtil.getDefaultByNullString(null, "--"));
            }


            jsonArray.add(jsonObject);
        }

        result.put("rows", jsonArray);

        return result;

    }
}
